<template>
  <div>
    <myheader :backgroundColor="'purple'" :color="'#fff'"></myheader>
    <div class="main">
      <mygoods v-for="val in list" :key="val.id" :arr="val"></mygoods>
    </div>
    <myfooter :arr="list"></myfooter>
  </div>
</template>

<script>
import myheader from "./components/myheader";
import myfooter from "./components/myfooter";
import mygoods from "./components/mygoods";
export default {
  components: {
    myheader,
    myfooter,
    mygoods,
  },
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.$axios({
      url: "https://www.escook.cn/api/cart",
    }).then((res) => {
      console.log(res);
      this.list = res.data.list;
    });
  },
};
</script>

<style scoped>
.main {
  padding: 45px 0 50px 0;
}
</style>